package org.zlb.manager.entity;

import javax.persistence.*;
import java.util.Objects;

/**
 * TODO
 *
 * @author zhoulingbo
 * @date 2021/8/10 12:30
 */
@Entity
@Table(name = "org_role", schema = "admin", catalog = "")
public class OrgRole {
    private long roleId;
    private String roleName;
    private byte roleStatus;
    private int roleSeq;

    @Id
    @Column(name = "ROLE_ID")
    public long getRoleId() {
        return roleId;
    }

    public void setRoleId(long roleId) {
        this.roleId = roleId;
    }

    @Basic
    @Column(name = "ROLE_NAME")
    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    @Basic
    @Column(name = "ROLE_STATUS")
    public byte getRoleStatus() {
        return roleStatus;
    }

    public void setRoleStatus(byte roleStatus) {
        this.roleStatus = roleStatus;
    }

    @Basic
    @Column(name = "ROLE_SEQ")
    public int getRoleSeq() {
        return roleSeq;
    }

    public void setRoleSeq(int roleSeq) {
        this.roleSeq = roleSeq;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OrgRole orgRole = (OrgRole) o;
        return roleId == orgRole.roleId &&
                roleStatus == orgRole.roleStatus &&
                roleSeq == orgRole.roleSeq &&
                Objects.equals(roleName, orgRole.roleName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(roleId, roleName, roleStatus, roleSeq);
    }
}
